package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class PersonCreationTests extends TestBase{
  
  @Test
  public void testNonEmptyPersonCreation() throws Exception {
    openMainPage();
    gotoAddPersonsPage();
    DateBirth PersonBirthDay = new DateBirth();
    PersonBirthDay.dayBirth = "25";
    PersonBirthDay.mounthBirth = "November";
    PersonBirthDay.yearBirth = "1984";   
	PersonsData PersonData = new PersonsData();
	PersonData.firstName = "Zhukov";
	PersonData.address = "Novosibirsk, Lenin street";
	PersonData.email = "artyom.zhukov@ngs.ru";
	PersonData.email2 = "";
	PersonData.birthDay = PersonBirthDay;
	PersonData.group = "Rob";
	PersonData.homePhone = "123456";
	PersonData.mobPhone = "8974561235";
	PersonData.phone2 = "";
	PersonData.workPhone = "";
	fillPersonsForm(PersonData);
    extractPersonsCreation();
    returnToMainPage();
  }

  @Test
  public void testEmptyPersonCreation() throws Exception {
    openMainPage();
    gotoAddPersonsPage();
    DateBirth PersonBirthDay = new DateBirth("","","");
	PersonsData PersonData = new PersonsData("", "", "", "", "", "", "", PersonBirthDay, "", "", "");
	fillPersonsForm(PersonData);
    extractPersonsCreation();
    returnToMainPage();
  }  
  
}

